<?
require("config.php");

$Query = "SELECT 
	code,
	username,
	password,
	firstname,
	lastname,
	age,
	address,
	zip,
	city,
	country,
	tel,
	fax,
	email,
	website,
	profession,
	education,
	cardname,
	cardtype,
	cardno,
	expiration_date,
	status,
	registration_date,
	enrollment_date,
	ccs_followed  
FROM $table";

$r=myQuery($Query);


header("Content-type:application/vnd.ms-excel");  
header("Content-Disposition:filename=customer_" . date("Ymd") . ".xls");  

echo "Code\t";
echo "Username\t";
echo "Password\t";
echo "Firstname\t";
echo "Lastname\t";
echo "Age\t";
echo "Address\t";
echo "Zip\t";
echo "City\t";
echo "Country\t";
echo "Tel\t";
echo "Fax\t";
echo "Email\t";
echo "Website\t";
echo "Profession\t";
echo "Education\t";
echo "Credit Card Name \t";
echo "Credit Card Type\t";
echo "Credit Card No.\t";
echo "Expiration Date\t";
echo "Status\t";
echo "Member Registration Date\t";
echo "Latest Enrollment Date \t";
echo "Followed by \t\n";

for ($i=0;$i<count($r);$i++){

echo $r[$i][0] . "\t"; 
echo $r[$i][1] . "\t"; 
echo $r[$i][2] . "\t"; 
echo $r[$i][3] . "\t"; 
echo $r[$i][4] . "\t"; 
echo $r[$i][5] . "\t"; 
echo $r[$i][6] . "\t"; 
echo $r[$i][7] . "\t"; 
echo $r[$i][8] . "\t"; 
echo $r[$i][9] . "\t"; 
echo $r[$i][10] . "\t"; 
echo $r[$i][11] . "\t"; 
echo $r[$i][12] . "\t"; 
echo $r[$i][13] . "\t"; 
echo $r[$i][14] . "\t"; 
echo $r[$i][15] . "\t"; 
echo $r[$i][16] . "\t"; 
echo $r[$i][17] . "\t"; 
echo $r[$i][18] . "\t"; 
echo $r[$i][19] . "\t"; 
echo $r[$i][20] . "\t"; 
echo $r[$i][21] . "\t"; 
echo $r[$i][22] . "\t"; 
echo $r[$i][23] . "\t"; 
echo $r[$i][24] . "\t\n"; 
}
?>